package com.easybuy.gateway;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;

@SpringBootApplication
@Slf4j
@EnableDiscoveryClient
public class GatewayApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(GatewayApplication.class, args);

        ConfigurableEnvironment environment = run.getEnvironment();
        environment.getPropertySources().forEach(ps -> {
            if (ps instanceof MapPropertySource mps) {
                mps.getSource().forEach((k, v) -> {
                    log.info("{}:{}", k, environment.getProperty(k));
                });
            }
        });


        log.info("***************  running *********************");

    }

}
